"""
@File    : HW_object_orienter_programming_count.py
@Author  : WorldWind(1772830365@qq.com)
@Time    : 2025/7/11
"""


class Counter:
    value = 0

    def __init__(self):
        print('This is __init__ method. Counter class startup')

    def increment(self):
        self.value += 1

    def decrement(self):
        self.value -= 1

    def reset(self):
        self.value = 0

    def get_value(self):
        return self.value

    def __del__(self):
        print('This is __del__ method. The Counter class has been recycled')


counter = Counter()
while 1:
    if counter.get_value() < 10:
        counter.increment()
    else:
        break
for i in range(1,3):
    counter.decrement()
print(counter.get_value())